/*
 * Copyright 2021 ThoughtWorks, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@import "../../global/common";

.material-check-result {
  margin: 10px 0;
  min-height:  10px;

  &:empty {
    margin-top: 0;
  }

  .material-config-files {
    background-color: $success;
    font-size: 14px;
    margin: 0;
    padding: 15px;

    .results-title {
      font-weight: 600;
      margin-bottom: 1em;
    }

    .plugin-config-files {
      margin: 0;
      padding: 0;
      font-family: $font-family-monospace;

      .material-check-file, .file-list {
        margin: 0;
        padding: 0;
      }

      .material-check-file {
        list-style: square;
        list-style-position: inside;
        min-height: 10px;
        margin-left: 15px;
        padding: 0 10px;

        &:nth-of-type(2n + 1) {
          background-color: lighten($success, 5%);
        }
      }
    }
  }
}

.material-check-container {
  width: 100%;
  margin: 0;
  padding: 0;
}

.material-check-control {
  justify-content: space-between;
}

.material-check-message {
  p {
    margin: 0;
    margin-bottom: 1em;

    &:last-of-type {
      margin-bottom: 0;
    }
  }
}

@mixin material-check-button-icon($type, $colors: $icon-light-color, $size: 5px) {
  @include icon-before($type: $type, $color: $colors, $size: 15px, $margin: 0) {
    display:      inline-block;
    margin-right: $size;
    @content
  }
  font-size: 11px;
}

.material-check-success {
  @include material-check-button-icon($type: $fa-var-check);
}

.material-check-failure {
  @include material-check-button-icon($type: $fa-var-exclamation);
}

.material-check-in-progress {
  @include material-check-button-icon($type: $fa-var-spinner) {
    animation: rotate 0.8s linear infinite;
  }

  @keyframes rotate {
    from {
      transform: rotate(0deg);
    }

    to {
      transform: rotate(359deg);
    }
  }
}

